
// pages/meme/meme.js
Page({
  data: {
    emojis: [
      { id: 1, src: '/assets/images/caihongpi.png', category: '搞笑' },
      { id: 2, src: '/assets/images/dgryl.png', category: '搞笑' },
      { id: 3, src: '/assets/images/dujitang.png', category: '搞笑' },
      { id: 4, src: '/assets/images/gulu.jpg', category: '搞笑' },
      { id: 5, src: '/assets/images/l1.png', category: '表情' },
      { id: 6, src: '/assets/images/l2.png', category: '表情' },
      { id: 7, src: '/assets/images/l3.png', category: '表情' },
      { id: 8, src: '/assets/images/l4.png', category: '表情' },
      { id: 9, src: '/assets/images/mahuateng.png', category: '人物' },
      { id: 10, src: '/assets/images/mayun.jpg', category: '人物' },
      { id: 11, src: '/assets/images/刘强东.jpg', category: '人物' },
      { id: 12, src: '/assets/images/profile/刘邦.jpg', category: '人物' },
      { id: 13, src: '/assets/images/profile/嬴政.jpg', category: '人物' },
      { id: 14, src: '/assets/images/profile/张良.jpg', category: '人物' },
      { id: 15, src: '/assets/images/menu/emoji.png', category: '表情' },
      { id: 16, src: '/assets/images/menu/look.png', category: '表情' },
      { id: 17, src: '/assets/images/menu/wea1.png', category: '天气' },
      { id: 18, src: '/assets/images/menu/wea3.png', category: '天气' },
      { id: 19, src: '/assets/images/01.png', category: '图标' },
      { id: 20, src: '/assets/images/02.png', category: '图标' },
      { id: 21, src: '/assets/images/03.png', category: '图标' },
      { id: 22, src: '/assets/images/04.png', category: '图标' },
      { id: 23, src: '/assets/images/05.png', category: '图标' },
      { id: 24, src: '/assets/images/06.png', category: '图标' }
    ],
    categories: ['全部', '搞笑', '表情', '人物', '天气', '图标'],
    activeCategory: '全部'
  },

  // 预览表情
  previewEmoji: function(e) {
    const src = e.currentTarget.dataset.src
    wx.previewImage({
      current: src,
      urls: this.data.emojis.map(item => item.src)
    })
  },

  // 发送表情
  sendEmoji: function() {
    wx.showToast({
      title: '表情已发送',
      icon: 'success'
    })
  },

  // 切换分类
  switchCategory: function(e) {
    this.setData({
      activeCategory: e.currentTarget.dataset.category
    })
  }
})